import { ProfileType } from '@/store/reducers/user';
import request from '@/utils/request';

//获取用户信息
export const getUserInfoApi = () => {
  return request({
    url: '/v1_0/user',
  });
};

//17.2.1 获取 用=户个人资料
export const getUserProfileApi = () => {
  return request({
    url: '/v1_0/user/profile',
  });
};

//17.4.1 编制用户头像
export const updatePhotoApi = (data: FormData) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'PATCH',
    data,
  });
};

// 18.3.1
/** 编辑用户个人资料  */
export const updateProfielApi = (data: Partial<ProfileType>) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'PATCH',
    data,
  });
};
